{% extends "adibilisadminBundle::layout.html.twig" %}

{% block title %}
  Liste de commandes - {{ parent() }}
{% endblock %}

{% block adibilisadmin_body %}

<h1>Liste de commandes</h1>

<table id="table_orders" class="table table-bordered">
    <thead>
        <tr>
            <th>Id</th>
            <th>Utilisateur</th>
            <th>Date de création</th>
            <th>Statut</th>
            <th>Actions</th>
        </tr>
    </thead>
    <tbody>
    {% for entity in entities %}
        <tr>
            <td><a href="{{ path('passorder_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td>
            <td>{{ entity.user.username }}</td>
            <td>{% if entity.date %}{{ entity.date|date('Y-m-d H:i:s') }}{% endif %}</td>
            <td>{{ entity.status.status }}</td>


            <td>
                <ul>

                    <li>
                        <a href="{{ path('passorder_edit', { 'id': entity.id }) }}">Détails/modifier</a>
                    </li>
                </ul>




            </td>
        </tr>
    {% endfor %}
    </tbody>
</table>








<script>

window.onload = loadTable;

function loadTable()
    {
                 
                 $('#table_orders').dataTable(

                                {

                                  "iDisplayLength": 5,
                                  "aLengthMenu": [[5, 10, 25, 50, -1], [5, 10, 25, 50, "All"]],
                                  

                                    "oLanguage": {
                                      "sLengthMenu": "Commandes par page :  _MENU_ ",
                                      "sZeroRecords": "Rien trouvé - désolé",
                                      "sInfo": " _START_ à _END_ sur _TOTAL_ enregistrements",
                                      "sInfoEmpty": " 0 à 0 sur 0 enregistrements",
                                      "sSearch": "Champ de recherche :",
                                      "sNext": "Suivant",
                                      "sInfoFiltered": "(filtré depuis _MAX_ enregistrements)",
                                      "oPaginate": {
                                            "sFirst":      "Premier",
                                            "sPrevious":   "Pr&eacute;c&eacute;dent",
                                            "sNext":       "Suivant",
                                            "sLast":       "Dernier"
                                        },
                                    }
                                  }

                            );





              }


</script>








{% endblock %}